<template>
	<view class="messageItem">
		<view class="header">
			<view class="userBox">
				<view class="userIMG"
					:style="{'background-image':message.HeadIcon?`url(${URL}${message.HeadIcon})`:`url(/static/static/images/avatar.png)`}">
				</view>
				<view class="user">
					{{message.UserName}}
				</view>
				<view class="time">
					{{message.CreatedTime.slice(0,10)}}
				</view>
			</view>
			<view class="pinjia">
				<u-rate :count="5" :value="message.Grade" activeColor="#FFBC00" readonly inactiveColor="#EEEEEE"></u-rate>
			</view>
		</view>
		<view class="content">
			{{message.Content}}
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			message: {
				typeof: Object,
				default: {}
			}
		},
		data() {
			return {
				URL: this.$config.domain.staticUrl,
			};
		}
	}
</script>

<style lang="scss" scoped>
	.messageItem {
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
		padding: 20rpx 24rpx 0rpx 24rpx;

		.header {
			font-family: PingFang SC-Regular;
			display: flex;
			flex-direction: row;
			justify-content: flex-start;

			.userBox {
				flex: 1;
				display: flex;
				flex-direction: row;
				justify-content: flex-start;

				.userIMG {
					width: 40rpx;
					height: 40rpx;
					background-repeat: no-repeat;
					background-size: 100%;
					overflow: hidden;
					border-radius: 50%;
				}

				.user {
					font-size: 26rpx;
					margin-left: 20rpx;
					margin-right: 20rpx;
				}

				.time {
					font-size: 24rpx;
					color: #999999;
				}

			}

			.pinjia {
				width: 200rpx;
			}
		}

		.content {
			margin-left: 60rpx;
			margin-top: 10rpx;
			color: #000000;
			font-size: 28rpx;
			font-family: PingFang SC-Regular;
			padding-bottom: 20rpx;
			border-bottom: 2rpx solid rgba(112, 112, 112, 0.12);
		}
	}
</style>